import type { ApprovalMyTaskReq, PageReq, PickupMyTaskReq, QueryCirculationRecordsReq, QueryTaskImageReq, RevertMyTaskReq } from './taskType'
import request from '@/utils/http/request'

/**
 * 分页查询我的待办任务
 */
export function getMyTaskPage(data: PageReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/myTodoTask',
    data,
  })
}

/**
 * 审批待办任务
 */
export function approvalMyTask(data: ApprovalMyTaskReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/approvalMyTask',
    data,
  })
}

/**
 * 拾取任务
 */
export function pickupMyTask(data: PickupMyTaskReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/pickupMyTask',
    data,
  })
}

/**
 * 归还任务
 */
export function returnMyTask(data: RevertMyTaskReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/revertMyTask',
    data,
  })
}

/**
 * 查询任务进度流程图
 */
export function queryTaskImage(data: QueryTaskImageReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/queryTaskImage',
    data,
  })
}

/**
 * 分页查询我发起的任务
 */
export function queryMyStartTaskList(data: PageReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/queryMyStartTaskList',
    data,
  })
}

/**
 * 查询流转记录
 */
export function queryCirculationRecords(data: QueryCirculationRecordsReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/queryCirculationRecords',
    data,
  })
}

/**
 * 查询我的已办任务
 */
export function queryMyCompleteTaskList(data: PageReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/myTask/queryMyCompleteTaskList',
    data,
  })
}
